#ifndef QIMAGEWIDGET_H
#define QIMAGEWIDGET_H

#include <QWidget>
#include <QImage>
#include <QPainter>
#include <QMouseEvent>
#include <QPoint>

class QImageWidget : public QWidget
{
    Q_OBJECT

private:
    QImage* image;

protected:
    void paintEvent(QPaintEvent*);
    void mouseReleaseEvent(QMouseEvent*);

public:
    QImageWidget(QWidget* parent = 0);
    QImageWidget(QImage* image, QWidget* parent = 0);
    QImageWidget(QImage image, QWidget* parent = 0);
    QImageWidget(QString path, QWidget* parent = 0);
    ~QImageWidget();

    void setSize(QSize size);
    void setSize(int height, int width);
    void setImage(QImage* image);
    void setImage(QImage image);
    void setImage(QString path);
    QSize getSize() const;
    int getHeiht();
    int getWidth();
    QImage getImage(QRect* region = 0) const;

signals:
    void pointClicked(QPoint);

};

#endif // QIMAGEWIDGET_H
